import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login'
import Home from '@/components/Home'
import UserInfo from '@/components/UserInfo'
import RoleInfo from '@/components/RoleInfo'
import UserEdit from '@/components/UserEdit'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/login',
      name: '登录',
      component: Login
    },
    {
      path: '/home',
      name: '主界面',
      component: Home,
      children: [
        {
          path: '/userInfo',
          name: '用户模块',
          component: UserInfo
        },
        {
          path: '/roleInfo',
          name: '角色模块',
          component: RoleInfo
        },
        {
          path: '/userEdit',
          name: '角色模块',
          component: UserEdit
        }
      ]
    }
  ]
})
